﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
namespace BTCairo
{
    public class PNGType : SaveType
    {
        public PNGType(List<Shape> list, string _path, InfoGraphic _info)
        {
            this.listShape = list;
            this.path = _path;
            this.InfoGraphic = _info;
        }

        public override void Save()
        {
            //Code here
            Bitmap bitmap = new Bitmap(800, 500);
            CommonGraphics gdiGraphic = new GDIPlus(Graphics.FromImage(bitmap), InfoGraphic);
            foreach (Shape shape in listShape)
            {
                shape.myCommonGraphic = gdiGraphic;
                shape.Draw();
            }
            path = path + @".png";
            bitmap.Save(path, System.Drawing.Imaging.ImageFormat.Png);
        }
    }
}
